<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>修改收货信息</h2>
  </div>    

  <!-- 订单信息 -->
  <div class="order-box">
    <p>
      <strong>订单状态：</strong>
      <switch name="info.o_status">
        <case value="-1|404"><span class="text-danger">交易取消</span></case>
        <case value="0"><span class='text-danger'>待付款</span></case>
        <case value="200"><span class="text-success">待发货</span></case>
        <case value="201"><span class="text-success">待买家确认收货</span></case>
        <case value="202"><span class="text-success">交易成功</span></case>
        <case value="303"><span class="text-success">已退款</span></case>
        <case value="300|301|302">
          <span class="text-danger">
            退款中
            <if condition="$info['o_status'] eq 301">，待买家退货</if>
            <if condition="$info['o_status'] eq 302">，买家已退货</if>
          </span>
          <a href="javascript:UI.load('{:U('Order/refund',array('order_id' => $info['id']))}','处理退款');">[处理退款]</a>
        </case>
      </switch>
      <gt name="info.o_status" value="0">
        <span class="sep"></span>
        <strong>付款状态：</strong>{$info['o_status']>0 ?'<span class="text-success">已付款</span>':'<span class="text-danger">未付款</span>'}
        <span class="sep"></span>
        <strong>支付方式：</strong>
        <gt name="info.o_status" value="0">
          <if condition="$info.order_total_amount eq 0">
            余额支付
            <else/>
            {$info.payment_type_text}
          </if>
        <else/>
          -
        </gt>
        <span class="sep"></span>
        <strong>发货状态：</strong>{$info['shipping_time']>0 ?'<span class="text-success">已发货</span>':'<span class="text-danger">未发货</span>'}
      </gt>
    </p>
    <p>
      <strong>订单编号：</strong>{$info.order_sn} <if condition="$info['payment_time'] gt 0 AND $info['sdp_uid'] gt 0"> <span class="order-sdp">分销</span></if>
      <span class="sep"></span>
      <strong>订单总额：</strong><span class="text-danger">{:sprintf('%.2f', $info['total_amount'])} </span> 元
      <span class="sep"></span>
      <strong>下单用户：</strong>
      <if condition="IS_SUPPLIER">
        {$info.uid|get_nickname}
        <else/>
        <a href="{:U('User/view?id='.$info['uid'])}">{$info.uid|get_nickname}</a>
      </if>
      
      <span class="sep"></span>
      <strong>下单时间：</strong>{$info.create_time|time_format}
      <span class="sep"></span>
      <eq name="info.o_status" value="202">
        <gt name="info.complete_time" value="0">
          <strong>交易完成时间：</strong>{$info.complete_time|time_format}
        </gt>
      </eq>
    </p>
    <p>
      <form action="{:U('Order/save')}" method="POST" >
      <strong>收货人姓名：</strong> <input type="text"  value="{$info.ship.ship_uname}" name="ship_uname">

      <strong>手机：</strong><input type="text"  value="{$info.ship.ship_mobile}" name="ship_umobile">
      <notempty name='info.ship.ship_phone'>
        <strong>座机：</strong>{$info.ship.ship_phone|default='-'}
      </notempty>
      <notempty name='info.delivery_tpl'>
        <span class="sep"></span>
        <strong>买家指定：</strong><span class="text-warning">{$info.delivery_tpl}</span>
      </notempty>
      <notempty name='info.ship.ship_zipcode'>
        <span class="sep"></span>
        <strong>邮编：</strong><input type="text"  value="{$info.ship.ship_zipcode}" name="ship_zipcode">
      </notempty>
      <br/>
      <div style="margin-top:10px">
      <strong>收货地址：{:Hook('areaSelect',array('province'=>$info['ship']['ship_province'],'city'=>$info['ship']['ship_city'],'district'=>$info['ship']['ship_district'] ))}
      <input type="text" name="ship_address" value="{$info.ship.ship_address}" style="height:38px" />
      </strong>
      </div>
      <input type="hidden" name="ship_id" value = {$info.ship.id}>
      <input type="hidden" name="order_sn" value="{$info.order_sn}">
    </p>

  </div>



  <!-- 结算合计 -->

  <!-- 分销 -->

  
  <!-- 发货信息 -->

  
  <div>

    <input type="submit" value="提交" class="btn btn-return">
    </form>
  </div>
</block>

<block name="script">
  <script type="text/javascript">
    //导航高亮
    highlight_subnav("{:U('index')}");
  </script>
</block>
